package com.qst.beans;

public class CartItem {
    private double subtotal;//小计
    private Product product;//商品
    private int count;//数量

    public Product getProduct() {
        return product;
    }

    public void setProduct(Product product) {
        this.product = product;
    }

    public Integer getCount() {
        return count;
    }

    public void setCount(Integer count) {
        this.count = count;
    }

    /*得到商品项总额*/
    public double getSubtotal() {
       return count*product.getShop_price();
    }

    @Override
    public String toString() {
        return "CartItem{" +
                "subtotal=" + subtotal +
                ", product=" + product +
                ", count=" + count +
                '}';
    }
}
